<%    
    /*@ 扩展Object的静态方法 */
    Object.extend
    (
         Object,
        {              
            clone: function($object) 
            {
                return Object.extend({},$object);
            },
            clear:function($object)
            {
                for(var iObject in $object){
                    delete this[iObject];
                }                
            },
            inspect:function($object) 
            {
                try 
                {
                    if ($object===undefined) return 'undefined';
                    if ($object===null) return 'null';
                    return $object.inspect ? $object.inspect():$object.toString();
                }catch(e) 
                {
                    if (e instanceof RangeError) return '...';
                    throw e;
                }
            },        
            isArray:function($value)
            {
                return varType($value)=='array';
            },              
            isFunction:function($value)
            {            
                return varType($value)=='function';
            },            
            isHash:function($object)
            {
                return $object instanceof Hash;
            },
            isNumber:function($value)
            {
                return varType($value)=='number';
            },                
            isNumeric:function($value)
            {
                return isNumeric($value);
            },        
            isString:function($value)
            {
                return varType($value)=='string';
            },                                        
            isUndefined:function($value)
            {
                return varType($value)=='undefined';
            },                
            keys: function($object) 
            {
                var keys = [];
                for (var property in $object)
                    keys.push(property);
                return keys;
            },            
            toJSON:function($object) 
            {
                var type=typeof $object;
                switch(type) 
                {
                    case 'undefined':
                    case 'function':
                    case 'unknown': return;
                    case 'boolean': return $object.toString();
                }            
                if($object===null) return 'null';
                if($object.toJSON) return $object.toJSON();
                //if(Object.isElement(object)) return;                
                var results=[];
                for(var property in $object){
                    var value = Object.toJSON($object[property]);
                    if(value!==undefined)
                    results.push(property.toJSON() + ': ' + value);
                }            
                return '{'+results.join(', ')+'}';
            },            
            toQueryString:function($object) 
            {
                return $H($object).toQueryString();
            },            
            values:function($object) 
            {
                var values=[];
                for (var property in $object)
                {
                    values.push($object[property]);
                }
                return values;
            },                
            varType:function($value)
            {
                return varType($value);
            }            
        }
    );
%>